[SPARK-38579][SQL][WEBUI]Requesting Restful API can cause NullPointerException#35884
Closed
yimin-yang wants to merge 5 commits intoapache:masterfrom
Closed
[SPARK-38579][SQL][WEBUI]Requesting Restful API can cause NullPointerException#35884yimin-yang wants to merge 5 commits intoapache:masterfrom
yimin-yang wants to merge 5 commits intoapache:masterfrom
Conversation
91f64b8 to
5e444bf
Compare
8d04d75 to
76f2a2e
Compare
|
Can one of the admins verify this patch? |
weixiuli
reviewed
Mar 18, 2022
sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/SqlResource.scala
Show resolved
Hide resolved
mridulm
reviewed
Mar 18, 2022
| printableMetrics(graph.allNodes, exec.metricValues) | ||
| } else { | ||
| printableMetrics(graph.allNodes, new HashMap[Long, String]) | ||
| } |
Contributor
There was a problem hiding this comment.
Option(exec.metricValues).getOrElse(Map()) instead
Contributor
Author
martin-g
reviewed
Mar 22, 2022
sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/SqlResource.scala
Outdated
Show resolved
Hide resolved
martin-g
approved these changes
Mar 22, 2022
Contributor
Author
|
@martin-g Could you merge this PR? Thx |
Member
|
I am just a contributor here. |
wangyum
reviewed
Mar 22, 2022
sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/SqlResource.scala
Outdated
Show resolved
Hide resolved
wangyum
approved these changes
Mar 22, 2022
wangyum
pushed a commit
that referenced
this pull request
Mar 22, 2022
…rException
### What changes were proposed in this pull request?
Added null check for `exec.metricValues`.
### Why are the changes needed?
When requesting Restful API {baseURL}/api/v1/applications/$appId/sql/$executionId which is introduced by this PR #28208, it can cause NullPointerException. The root cause is, when calling method doUpdate() of `LiveExecutionData`, `metricsValues` can be null. Then, when statement `printableMetrics(graph.allNodes, exec.metricValues)` is executed, it will throw NullPointerException.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Tested manually.
Closes #35884 from yym1995/fix-npe.
Lead-authored-by: Yimin <yimin.y@outlook.com>
Co-authored-by: Yimin Yang <26797163+yym1995@users.noreply.github.com>
Signed-off-by: Yuming Wang <yumwang@ebay.com>
(cherry picked from commit 99992a4)
Signed-off-by: Yuming Wang <yumwang@ebay.com>
wangyum
pushed a commit
that referenced
this pull request
Mar 22, 2022
…rException
### What changes were proposed in this pull request?
Added null check for `exec.metricValues`.
### Why are the changes needed?
When requesting Restful API {baseURL}/api/v1/applications/$appId/sql/$executionId which is introduced by this PR #28208, it can cause NullPointerException. The root cause is, when calling method doUpdate() of `LiveExecutionData`, `metricsValues` can be null. Then, when statement `printableMetrics(graph.allNodes, exec.metricValues)` is executed, it will throw NullPointerException.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Tested manually.
Closes #35884 from yym1995/fix-npe.
Lead-authored-by: Yimin <yimin.y@outlook.com>
Co-authored-by: Yimin Yang <26797163+yym1995@users.noreply.github.com>
Signed-off-by: Yuming Wang <yumwang@ebay.com>
(cherry picked from commit 99992a4)
Signed-off-by: Yuming Wang <yumwang@ebay.com>
wangyum
pushed a commit
that referenced
this pull request
Mar 22, 2022
…rException
### What changes were proposed in this pull request?
Added null check for `exec.metricValues`.
### Why are the changes needed?
When requesting Restful API {baseURL}/api/v1/applications/$appId/sql/$executionId which is introduced by this PR #28208, it can cause NullPointerException. The root cause is, when calling method doUpdate() of `LiveExecutionData`, `metricsValues` can be null. Then, when statement `printableMetrics(graph.allNodes, exec.metricValues)` is executed, it will throw NullPointerException.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Tested manually.
Closes #35884 from yym1995/fix-npe.
Lead-authored-by: Yimin <yimin.y@outlook.com>
Co-authored-by: Yimin Yang <26797163+yym1995@users.noreply.github.com>
Signed-off-by: Yuming Wang <yumwang@ebay.com>
(cherry picked from commit 99992a4)
Signed-off-by: Yuming Wang <yumwang@ebay.com>
Member
|
Merged to maser, branch-3.3, branch-3.2 and branch-3.1. |
kazuyukitanimura
pushed a commit
to kazuyukitanimura/spark
that referenced
this pull request
Aug 10, 2022
…rException
### What changes were proposed in this pull request?
Added null check for `exec.metricValues`.
### Why are the changes needed?
When requesting Restful API {baseURL}/api/v1/applications/$appId/sql/$executionId which is introduced by this PR apache#28208, it can cause NullPointerException. The root cause is, when calling method doUpdate() of `LiveExecutionData`, `metricsValues` can be null. Then, when statement `printableMetrics(graph.allNodes, exec.metricValues)` is executed, it will throw NullPointerException.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Tested manually.
Closes apache#35884 from yym1995/fix-npe.
Lead-authored-by: Yimin <yimin.y@outlook.com>
Co-authored-by: Yimin Yang <26797163+yym1995@users.noreply.github.com>
Signed-off-by: Yuming Wang <yumwang@ebay.com>
(cherry picked from commit 99992a4)
Signed-off-by: Yuming Wang <yumwang@ebay.com>
(cherry picked from commit c3aace7)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Added null check for
exec.metricValues.Why are the changes needed?
When requesting Restful API {baseURL}/api/v1/applications/$appId/sql/$executionId which is introduced by this PR #28208, it can cause NullPointerException. The root cause is, when calling method doUpdate() of
LiveExecutionData,metricsValuescan be null. Then, when statementprintableMetrics(graph.allNodes, exec.metricValues)is executed, it will throw NullPointerException.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Tested manually.